package com.relytosoft.mizar.analyze.common.config;

import com.relytosoft.mizar.analyze.common.config.properties.MizarAnalyzeProperties;
import com.relytosoft.mizar.analyze.common.filter.AuthFilter;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean;
import org.springframework.boot.context.properties.EnableConfigurationProperties;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

/**
 * @author Jierry
 * @version 2022/4/2.
 */

@Configuration
@EnableConfigurationProperties({MizarAnalyzeProperties.class})
public class MizarAnalyzeConfiguration {

    private static final Logger log = LoggerFactory.getLogger(MizarAnalyzeConfiguration.class);

    @Bean
    @ConditionalOnMissingBean
    public AuthFilter authFilter() {
        AuthFilter authFilter = new AuthFilter();
        log.trace("[RelytoSoft.Mizar] |- Bean [AuthFilter Filter] Auto Configure.");
        return authFilter;
    }
}
